package com.mazaiting.manager.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mazaiting.mybatisplus.domain.entity.BaseUserEntity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * sys_user_role 用户角色中间表
 *
 * @author mazaiting
 * @since 2022-03-29
 */
@Setter
@Getter
@NoArgsConstructor
@TableName("sys_user_role")
public class SysUserRole extends BaseUserEntity {

    /**
     * 主键ID
     */
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 用户ID
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 角色 ID 
     */
    @TableField("role_id")
    private Long roleId;

    public SysUserRole(Long userId, Long roleId) {
        this.userId = userId;
        this.roleId = roleId;
    }

}
